package com.example.mall.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.math.BigDecimal;
import java.util.Date;

import java.io.Serializable;

/**
 * <p>
 * 性能日志表
 * </p>
 *
 * @author whale
 * @since 2025-05-16
 */
@TableName("tb_performance_logs")
public class PerformanceLogs extends Model<PerformanceLogs> {

    private static final long serialVersionUID = 1L;

    /**
     * 性能日志唯一标识
     */
    @TableId("performance_id")
    private Long performanceId;
    /**
     * 模块名称（如订单模块、支付模块）
     */
    @TableField("module_name")
    private String moduleName;
    /**
     * 响应时间（单位：秒）
     */
    @TableField("response_time")
    private BigDecimal responseTime;
    /**
     * 吞吐量（单位：TPS）
     */
    private BigDecimal throughput;
    /**
     * CPU 使用率（百分比）
     */
    @TableField("cpu_usage")
    private BigDecimal cpuUsage;
    /**
     * 内存使用率（百分比）
     */
    @TableField("memory_usage")
    private BigDecimal memoryUsage;
    /**
     * 记录时间
     */
    @TableField("created_date")
    private Date createdDate;


    public Long getPerformanceId() {
        return performanceId;
    }

    public void setPerformanceId(Long performanceId) {
        this.performanceId = performanceId;
    }

    public String getModuleName() {
        return moduleName;
    }

    public void setModuleName(String moduleName) {
        this.moduleName = moduleName;
    }

    public BigDecimal getResponseTime() {
        return responseTime;
    }

    public void setResponseTime(BigDecimal responseTime) {
        this.responseTime = responseTime;
    }

    public BigDecimal getThroughput() {
        return throughput;
    }

    public void setThroughput(BigDecimal throughput) {
        this.throughput = throughput;
    }

    public BigDecimal getCpuUsage() {
        return cpuUsage;
    }

    public void setCpuUsage(BigDecimal cpuUsage) {
        this.cpuUsage = cpuUsage;
    }

    public BigDecimal getMemoryUsage() {
        return memoryUsage;
    }

    public void setMemoryUsage(BigDecimal memoryUsage) {
        this.memoryUsage = memoryUsage;
    }

    public Date getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(Date createdDate) {
        this.createdDate = createdDate;
    }


    @Override
    public String toString() {
        return "PerformanceLogs{" +
        ", performanceId=" + performanceId +
        ", moduleName=" + moduleName +
        ", responseTime=" + responseTime +
        ", throughput=" + throughput +
        ", cpuUsage=" + cpuUsage +
        ", memoryUsage=" + memoryUsage +
        ", createdDate=" + createdDate +
        "}";
    }
}
